﻿Imports Microsoft.ApplicationBlocks.Data
Namespace DotNetNuke.Modules.ActiveForums.Data
    Public Class PropertiesDB
        Inherits Connection
        Friend Function ListProperties(ByVal PortalId As Integer, ByVal ObjectType As Integer, ByVal ObjectOwnerId As Integer) As IDataReader
            Return CType(SqlHelper.ExecuteReader(connectionString, dbPrefix & "Properties_List", PortalId, ObjectType, ObjectOwnerId), IDataReader)
        End Function
        Friend Function GetProperties(ByVal PropertyId As Integer, ByVal PortalId As Integer) As IDataReader
            Return CType(SqlHelper.ExecuteReader(connectionString, dbPrefix & "Properties_Get", PropertyId, PortalId), IDataReader)
        End Function
        Friend Function SaveProperty(ByVal PropertyId As Integer, ByVal PortalId As Integer, ByVal ObjectType As Integer, ByVal ObjectOwnerId As Integer, ByVal Name As String, ByVal DataType As String, ByVal DefaultAccessControl As Integer, ByVal IsHidden As Boolean, ByVal IsRequired As Boolean, ByVal IsReadOnly As Boolean, ByVal ValidationExpression As String, ByVal EditTemplate As String, ByVal ViewTemplate As String, ByVal SortOrder As Integer, ByVal DefaultValue As String) As Integer
            Return CType(SqlHelper.ExecuteScalar(connectionString, dbPrefix & "Properties_Save", PropertyId, PortalId, ObjectType, ObjectOwnerId, Name, DataType, DefaultAccessControl, IsHidden, IsRequired, ValidationExpression, EditTemplate, ViewTemplate, IsReadOnly, SortOrder, DefaultValue), Integer)
        End Function
        Friend Sub SortRebuild(ByVal PortalId As Integer, ByVal ObjectType As Integer, ByVal ObjectOwnerId As Integer)
            SqlHelper.ExecuteNonQuery(connectionString, dbPrefix & "Properties_RebuildSort", PortalId, ObjectType, ObjectOwnerId)
        End Sub
        Friend Sub DeleteProperty(ByVal PortalId As Integer, ByVal PropertyId As Integer)
            SqlHelper.ExecuteNonQuery(connectionString, dbPrefix & "Properties_DeleteDefTopicProp", PortalId, PropertyId)
        End Sub
    End Class
End Namespace
